<?PHP
session_start();
include("common/common.php");
include("common/connect.php");

$ref = CheckUrlParamNoDie("ref");
$user = trim(GetPostParamStr("user"));
$psw = trim(GetPostParamStr("psw"));

$_account = array();
$_account["zjb"] = "72b487635ab672f74d88d3be317d33c5";
$_account["zjj"] = "be78e5a4c74b7c01af5c26909dbae8bd";
$_account["zyz"] = "7f8544725421910024ca66d10ceddcdd";
$_account["yls"] = "03721a95d00080676301e481b109632c";
$_account["wf"] = "d8e423a9d5eb97da9e2d58cd57b92808";
//$_account["ldj"] = "";

if( isset($_account[$user]) && $_account[$user] != "" && md5($psw) == $_account[$user] )
{
	if (Trim($user) == "")
	{
		echo "<script>alert('输入有误！');</script>";
	}
	else
	{
		$_SESSION["user"] = $user;
		setcookie("gwt_admin_user", "$user");
		
		$ip = gethostbyname($_SERVER["REMOTE_ADDR"]);
		mysql_query( "insert into admin_report (un, args, type, ip) values('$user', '', 'login', '$ip')" );

		$url = "Location:".$ref;
		header($url);
	}
}
else if ($psw != "")
{
	echo "<script>alert('密码错误！');</script>";
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
<form action="login.php?ref=<?PHP echo $ref; ?>" method="post" id="RegId">
		用户名：<input name="user" tabindex="1" width="200" type="text"><br /><br />
    	密码：<input name="psw" tabindex="2" width="200" type="password"><br /><br />
        <input type="submit" value="登录" />
</form>
</body>
</html>